<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
</html>
<script>
    const url = 'https://www.pthome.net/details.php?id=176809&hit=1'
    const tabs = [
        {
            active: false,
            audible: false,
            autoDiscardable: true,
            discarded: false,
            favIconUrl: "https://ydlunacommon-cdn.nosdn.127.net/31cf4b56e6c0b3af668aa079de1a898c.png",
            groupId: -1,
            height: 1279,
            highlighted: false,
            id: 1358698657,
            incognito: false,
            index: 0,
            lastAccessed: 1710319628213.822,
        },
        {
            active: false,
            audible: false,
            autoDiscardable: true,
            discarded: false,
            groupId: -1,
            height: 0,
            highlighted: false,
            href: "https://www.pthome.net/details.php",
            id: 1358699651,
            incognito: false,
            index: 12,
            lastAccessed: 1710320683883.233,
        },
        {
            active: false,
            audible: false,
            autoDiscardable: true,
            discarded: false,
            groupId: -1,
            height: 0,
            highlighted: false,
            href: "https://audiences.me/details.php",
            id: 1358699646,
            incognito: false,
            index: 11,
            lastAccessed: 1710320691774.186,
        },
        {
            active: false,
            audible: false,
            autoDiscardable: true,
            discarded: false,
            groupId: -1,
            height: 0,
            highlighted: false,
            href: "https://www.pthome.net/details.php",
            id: 1358699651,
            incognito: false,
            index: 12,
            lastAccessed: 1710320683883.233,
        }
    ]

    const index = tabs.findIndex((item,index) => url.includes(item.href) && ![0,1,2].includes(index))
    console.log(index)
    // let index = tabs.findIndex(item => url.indexOf(item.href) !== -1)
    // tabs.forEach(item => {
    //     index = url.indexOf(item.href)
    // })
    // console.log(index)
</script>
